{layout name="public::layout" /}

<h4 class="text-center text-success">文章管理</h4>

<table class="table table-default table-striped table-bordered table-hover text-center">
    <tr>
        <td>ID</td>
        <td>标题</td>
        <td>栏目名称</td>
        {eq name="$Think.session.admin_level" value="1"}
        <td>作者</td>
        {/eq}
        <td>阅读量</td>
        <td>创建时间</td>
        <td colspan="2">操作</td>
    </tr>
    {volist name="artList" id="art" empty="$empty"}
    <tr>
        <td>{$art.id}</td>
        <td>{$art.title}</td>
        <td>{$art.cate_id|getCateName}</td>
        {eq name="$Think.session.admin_level" value="1"}
        <td>{$art.user_id|getUserName}</td>
        {/eq}
        <td>{$art.pv}</td>
        <td>{$art.create_time}</td>
        <td><a href="{:url('article/artEdit',['id'=>$art.id])}">编辑</a></td>
        <td><a href="" onclick="dele({$art.id});return false;">删除</a></td>
    </tr>
    {/volist}
</table>

<div class="text-center">{$artList|raw}</div>

<script>
    function dele(id) {
        if (confirm('您是真的要删除吗？') == true){
            window.location.href = "{:url('article/doDelete')}"+"?id="+id;
        }
    }
</script>